package com.bsoft.controller;


import com.bsoft.event.NoticeEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/BaseController")
public class BaseController {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    @RequestMapping("/getValue")
    public String getValue(){
        String ss = "是否触发事件";
        applicationEventPublisher.publishEvent(new NoticeEvent(ss));

        return "ok";
    }


    @RequestMapping("/getValue2/jk")
    public String getValue2(){
        String ss = "是否出发事件";
        applicationEventPublisher.publishEvent(new NoticeEvent(ss));

        return "ok";
    }


}
